import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: ()=>import ('./../pages/home'),
      redirect:'/activity',
      name: 'Home'
    },
    {
      path:'/home',
      component: ()=>import ('./../pages/home'),
      name: 'Home',
      redirect:'/activity',
      children:[
        {
          path:'/activity',
          component: ()=>import ('./../pages/home/activity'),
          name: 'Activity'
        },
        {
          path:'/rank',
          component: ()=>import ('./../pages/home/rank'),
          name: 'Rank'
        }
      ]
    }
  ],
  scrollBehavior (to, from, savedPosition) {
    if (savedPosition) {
     return savedPosition
    } else {
     return { x: 0, y: 0 }
    }
    }
})
